package com.hk.langchain4j_springboot.AiService;


//版本3

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,//手动装配
        chatModel = "openAiChatModel",//指定模型，自动向容器注入生成的bean的默认名称
        streamingChatModel = "openAiStreamingChatModel",
//        chatMemory = "chatMemory"//配置会话记忆对象
        chatMemoryProvider = "chatMemoryProvider"//配置会话记忆提供者对象
)

public interface ClientService {
    //用于聊天
    //  public String chat(String message);
// TODO
//   方法1 @SystemMessage("你是我的智能助手和好朋友贾维斯")
    //方法2
    @SystemMessage(fromResource = "system.txt")
//    public Flux<String> chat(String message);
    public Flux<String> chat(@MemoryId String memoryId,@UserMessage String message);
}
